<template>
    <div id="treatMent"> <el-form :model="form" label-width="auto" style="max-width: 600px" size="large">
      <el-form-item label="药品名称">
        <el-input v-model="form.name" />
      </el-form-item>
      <!-- <el-form-item label="Activity zone">
        <el-select v-model="form.region" placeholder="please select your zone">
          <el-option label="Zone one" value="shanghai" />
          <el-option label="Zone two" value="beijing" />
        </el-select>
      </el-form-item> -->
      <el-form-item label="药品单价">
        <el-input v-model="form.id" />
      </el-form-item>
      <el-form-item label="药品编号">
        <el-input v-model="form.id" />
      </el-form-item>
      <el-form-item label="药品供应商">
        <el-input v-model="form.id" />
      </el-form-item>
      <el-form-item label="药品简介">
        <el-input v-model="form.desc" type="textarea" size="large" :rows="15" style="width: 500px;"/>
      </el-form-item>
      <el-form-item style="margin-left: 250px;">
        <el-button type="primary" @click="onSubmit">提交</el-button>
      </el-form-item>
    </el-form></div>
  </template>
  
  <script lang="ts" setup>
  import { reactive } from 'vue'
  import { onMounted } from 'vue';
//   import { ref } from 'vue';
  import { useRoute } from 'vue-router';
  const route = useRoute()
  const form = reactive({
    name: '',
    id:'',
    region: '',
    date1: '',
    date2: '',
    delivery: false,
    type: [],
    resource: '',
    desc: '',
  })
  
  onMounted(()=>{
    console.log(route.query.id)
    form.name = route.query.name;
    form.id = route.query.id;
  })
//   console.log(id.value)
  // do not use same name with ref
  const onSubmit = () => {
    console.log('submit!')
  }
  </script>
  <style scoped>
  #treatMent {
    /* margin-top: 50px; */
    display: flex;
    justify-content: center;
  }
  </style>

function created() {
  throw new Error('Function not implemented.')
}
  